/* Estilo base del Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  margin: 20px;
  cursor: pointer;
}

/* Estilo del texto dentro del Tooltip */
.tooltip .tooltiptext {
  visibility: hidden;
  width: 150px;
  background-color: black;
  color: #fff;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s;
}

/* Mostrar el tooltip al hacer hover */
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Posición: Derecha */
.tooltip .right {
  top: -5px;
  left: 105%;
}

.tooltip .right::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent black transparent transparent;
}

/* Posición: Izquierda */
.tooltip .left {
  top: -5px;
  right: 105%;
}

.tooltip .left::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent black;
}

/* Posición: Arriba */
.tooltip .top {
  bottom: 100%;
  left: 50%;
  margin-left: -75px;
}

.tooltip .top::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: black transparent transparent transparent;
}

/* Posición: Abajo */
.tooltip .bottom {
  top: 100%;
  left: 50%;
  margin-left: -75px;
}

.tooltip .bottom::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent black transparent;
}
